package com.foreknow.service.impl;

import com.foreknow.dao.UserDao;
import com.foreknow.model.User;
import com.foreknow.service.UserService;

import java.sql.SQLException;

public class UserServiceImpl implements UserService {

    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public User isValidata(String username, String password) throws SQLException {
        return userDao.login(username,password);
    }

    @Override
    public boolean save(User user) throws SQLException {
        return userDao.register(user);
    }
}
